package top.techqi.hamtools.db.assist

import android.support.annotation.IntRange

enum class RstR(val value: Int) {
    UNKNOWN(0),
    UNREADABLE(1),
    BARELY(2),
    DIFFICULTY(3),
    READABLE(4),
    PERFECTLY(5);

    companion object {
        fun valueOf(@IntRange(from = 0, to = 5) value: Int): RstR {
            return when (value) {
                1 -> RstR.UNREADABLE
                2 -> RstR.BARELY
                3 -> RstR.DIFFICULTY
                4 -> RstR.READABLE
                5 -> RstR.PERFECTLY
                else -> RstR.UNKNOWN
            }
        }
    }
}
